﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "IGraphicsGroupBase.h"
#include "GraphicsRenderLayer.h"

namespace gcmp
{
    /// \brief Element图形表达图形节点
    class GCMP_GRAPHICS_NODE_INTERFACE_EXPORT IGraphicsElementShape : public IGraphicsGroupBase
    {
        DEFINE_CAST_DERIVED(IGraphicsElementShape, IGraphicsGroupBase)
    
    public:
        /// \brief 析构器
        virtual ~IGraphicsElementShape();

    public:
        /// \brief 获取Element的id
        /// \return Element的id
        virtual ElementId GetElementId() const = 0;

        /// \brief 获取所有子节点集合
        /// \return 所有子节点集合
        virtual std::vector<const IGraphicsNode*> GetAllChildren() const = 0;

        /// \brief 获取是否高亮可见
        /// \return true-是；false-否
        virtual bool IsHighlightable() const = 0;

        /// \brief 设置包围盒
        /// \param box 包围盒
        /// \return 无
        virtual void SetBox(const Box3d& box) = 0;

        /// \brief 设置Element的id
        /// \param id Element的id
        /// \return true-设置成功；false-设置失败
        virtual bool SetElementId(const ElementId& id) = 0;

        /// \brief 设置是否是特定视图图形表达
        /// \param inputValue 是否是特定视图图形表达：true-是；false-否
        /// \return 无
        virtual void SetIsModelViewSpecific(bool inputValue) const = 0;

        /// \brief 获取是否是特定视图图形表达
        /// \return true-是；false-否
        virtual bool IsModelViewSpecific() const = 0;

        /// \brief 设置是否是非序列化Element
        /// \param isTransient 是否是非序列化Element：true-是；false-否
        /// \return 无
        virtual void SetIsElementTransient(bool isTransient) const = 0;

        /// \brief 获取是否是非序列化Element
        /// \return true-是；false-否
        virtual bool IsElementTransient() const = 0;

        /// \brief 将Grep设置为注释裁剪
        virtual void EnableAnnotationClip() = 0;

        /// \brief 获取Grep是否参与注释裁剪
        virtual bool IsEnableAnnotationClip() const = 0;

        /// \brief 汇报拷贝时需要keep的有序id集合，获取无序id集合可以调用Report接口
        /// \param toKeep 汇报的有序id集合
        /// \return 无
        virtual void ReportOrdered(std::vector<ElementId>& toKeep) const = 0;

        /// \brief graphic element级别优先级偏移
        /// \return 返回element级别优先级偏移, 默认值为0 
        virtual Byte GetPriorityOffset() const = 0;

        /// \brief  graphic element级别优先级偏移
        /// \param priority 偏移值  范围-20到20。 影响当前图形表达下所有子节点
        virtual void SetPriorityOffset(Byte priority) = 0;

        /// \brief Grep是否设置BRep面节点高亮
        /// \param isHightlight 是否高亮面
        virtual void SetIsHighlightedByGraphicsBRepFace(bool isHightlight) = 0;

        /// \brief 设置Grep是否允许参与分批加载
        /// \param enableBatchLoad Grep是否允许参与分批加载，默认ture
        virtual void SetIsEnableBatchLoad(bool enableBatchLoad)  = 0;

        /// \brief 获取Grep是否允许参与分批加载
        /// \return Grep是否允许参与分批加载
        virtual bool IsEnableBatchLoad() const = 0;

    public:
        /// \brief 创建默认的Element图形表达图形节点
        /// \return Element图形表达图形节点
        static OwnerPtr<IGraphicsElementShape> Create();

        /// \brief 复制创建Element图形表达图形节点
        /// \param source 复制源
        /// \return Element图形表达图形节点
        static OwnerPtr<IGraphicsElementShape> Create(const IGraphicsElementShape* source);

        /// \brief 创建一个带有渲染层次类型的Element图形表达图形节点
        /// \param renderLayer 渲染层次类型
        /// \return Element图形表达图形节点
        /// \see GraphicsRenderLayer
        static OwnerPtr<IGraphicsElementShape> Create(GraphicsRenderLayer renderLayer);
    };
}
